import {MidwayConfig} from '@midwayjs/core';
//导入刚刚定义到的数据库类
// import User from "../pojo/entity/user.entity";

export default {
  // use for cookie sign key, should change to your own and keep security
  keys: '1711529855631_7806',
  typeorm: {
    dataSource: {
      default: {
        /**
         * 单数据库实例
         */
        type: 'mysql',
        host: 'www.yhuayi.com',
        port: 3306,
        username: 'root',
        password: 'YuFei123.',
        database: 'wangxu_gaduation_zp',
        synchronize: false,     // 如果第一次使用，不存在表，有同步的需求可以写 true，注意会丢数据
        logging: false,
        // 配置实体模型
        // entities: [User],
        entities: '**/entity/*.entity{.ts,.js}',
      }
    }
  },
  oss: {
    client: {
      accessKeyId: 'LTAI5tBXeSiSXnEh9ZiEmMky',
      accessKeySecret: 'sqVrrzZhr9Rg3CRf5fzfhq3OhvY1Rf',
      bucket: 'bucket-yufei',
      endpoint: 'oss-cn-hongkong.aliyuncs.com',
    },
  },
  koa: {
    port: 7001,

  },
  cors: {
    credentials:true,
    origin: "*"
  }
} as MidwayConfig;
